package com.dycong.common.function;

import org.apache.log4j.Logger;

import java.util.function.Consumer;

/**
 * Created by yu on 15-7-13.
 */
@FunctionalInterface
public interface EatenConsumer<T> extends Consumer<T> {

    Logger LOGGER = Logger.getLogger(EatenConsumer.class);

    void eatenAccept(T t) throws Throwable;

    @Override
    default void accept(T t) {
        try {
            eatenAccept(t);
        } catch (Throwable throwable) {
            LOGGER.warn("", throwable);
        }
    }
}
